package com.xlf.service.base.controller.client;

import com.xlf.common.core.annotation.Anonymous;
import com.xlf.common.core.pojo.mode.AjaxResult;
import com.xlf.common.core.pojo.mode.BaseController;
import com.xlf.pojo.base.ProblemList;
import com.xlf.service.base.pojo.dto.ProblemListReqDTO;
import com.xlf.service.base.service.ProblemListService;
import com.xlf.service.base.service.TagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

/**
 * @Author xlf 2734029211@qq.com
 * @Date 2023/10/3 10:18
 * @Description: TODO 题单模块
 * @Version 1.0
 */
@RestController
@RequestMapping("/base/problemList")
public class ProblemListController extends BaseController {

    @Autowired
    ProblemListService problemListService;

    @Anonymous
    @PostMapping("/list")
    public AjaxResult list(@RequestBody ProblemListReqDTO problemListReqDTO){
        return success(problemListService.getList(problemListReqDTO));
    }

    @Anonymous
    @GetMapping("/query/{id}")
    public AjaxResult query(@PathVariable(value = "id") String id){
        return success(problemListService.getProblemListVO(id));
    }


}
